package oop1;

import java.util.Scanner;

public class AdminiTest {

	public static void main(String[] args) {
		Administrator admin = new Administrator();

		admin.name = "oldliu";
		admin.pass = "1234568";
		// 1:admin.changePass();
		// 2:
		System.out.println("改密码:");
		System.out.println("请输入老密码老的用户名：");
		Scanner in = new Scanner(System.in);
		String oldName = in.next();
		String oldPass = in.next();
		if (admin.name.equals(oldName) && admin.pass.equals(oldPass)) {
			System.out.println("输入正确，请输入新密码：");
			admin.pass = in.next();// 新密码
			System.out.println("密码修改成功，用户名：" + admin.name + ",密码是：" + admin.pass);
		} else {
			System.out.println("密码修改失败，请提供正确的老用户和密码");
		}
	}

}
